/*
 * Copyright 2012 NJUT  qixiaobo. All rights reserved.
 */
package com.fujitsu.nanjing.mobile.webService.inter;

import com.fujitsu.nanjing.mobile.exception.WebServcieException;
import com.fujitsu.nanjing.mobile.model.Attendence;
import com.fujitsu.nanjing.mobile.model.EventMethod;
import com.fujitsu.nanjing.mobile.model.Guide;
import com.fujitsu.nanjing.mobile.model.Management;
import com.fujitsu.nanjing.mobile.model.Position;
import com.fujitsu.nanjing.mobile.model.Rate;
import com.fujitsu.nanjing.mobile.model.Result;
import com.fujitsu.nanjing.mobile.model.SuddenEventsModel;
import com.fujitsu.nanjing.mobile.model.UserInfoModel;
import com.fujitsu.nanjing.mobile.model.UserModel;

import java.util.List;

import javax.jws.WebParam;
import javax.jws.WebResult;
import javax.jws.WebService;

/**
 * SoapService.java
 * 
 * @author qixb.fnst
 */
@WebService
public interface SoapService {
    /**
     * 检验用户名和密码
     * */
    @WebResult(name = "result")
    public Result checkUser(@WebParam(name = "userId") String userId,
            @WebParam(name = "password") String password);

    /**
     * 检查版本
     * */
    @WebResult(name = "result")
    public Result checkVersion(@WebParam(name = "version") String version);

    /**
     * 设置版本号
     * */
    @WebResult(name = "result")
    public Result setVersion(@WebParam(name = "version") String version,
            @WebParam(name = "downloadUrl") String downloadUrl);

    /**
     * 下载用户信息
     * 
     * */
    @WebResult(name = "result")
    public UserModel downloadUserInfomation(
            @WebParam(name = "userId") String userId);
    
    
    /**
     * 根据主键获取用户信息
     * 
     * */
    @WebResult(name = "result")
    public UserInfoModel findUserById(
            @WebParam(name = "id") int id);
    
    /**
     * 根据主键获取用户名
     * 
     * */
    @WebResult(name = "result")
    public Result findUserNameById(
            @WebParam(name = "id") int id);

    /**
     * 用户修改密码
     * */
    @WebResult(name = "result")
    public Result modifyPassword(@WebParam(name = "userId") String userId,
            @WebParam(name = "password") String password,
            @WebParam(name = "newPassword") String newPassword);

    /**
     * 用户签到
     * */
    @WebResult(name = "result")
    public Result signIn(@WebParam(name = "userId") String userId,
            @WebParam(name = "XGPS") String XGps,
            @WebParam(name = "YGPS") String YGps);

//    /**
//     * 用户签退
//     * */
//    @WebResult(name = "result")
//    public Result signOut(@WebParam(name = "userId") String userId,  
//            @WebParam(name = "XGPS") String XGps,
//            @WebParam(name = "YGPS") String YGps,
//            @WebParam(name = "recordId")int recordId);
    /**
     * 用户签退
     * */
    @WebResult(name = "result")
    public Result signOut(@WebParam(name = "userId") String userId,  
            @WebParam(name = "XGPS") String XGps,
            @WebParam(name = "YGPS") String YGps);

    /**
     * 用户离岗
     * */
    @WebResult(name = "result")
    public Result leave(@WebParam(name = "userId") String userId,
            @WebParam(name = "reasonType") int reasonType);

//    /**
//     * 用户回岗
//     * */
//    @WebResult(name = "result")
//    public Result back(@WebParam(name = "userId") String userId,
//            @WebParam(name = "leaveRecord") int recordId);
//    
    /**
     * 用户回岗
     * */
    @WebResult(name = "result")
    public Result back(@WebParam(name = "userId") String userId);

    /**
     * 用户查询考勤
     * */
    @WebResult(name = "result")
    public List<Attendence> queryAttendance(
            @WebParam(name = "userId") String userId,
            @WebParam(name = "checkRecordId")int checkRecordId);

    /**
     * 用户查询离岗情况
     * */
    @WebResult(name = "result")
    public List<Guide> queryGuide(@WebParam(name = "userId") String userId,
            @WebParam(name = "scheduleId") int scheduleId);

    /**
     * 用户查询排班
     * */
    @WebResult(name = "result")
    public List<Management> queryManagement(
            @WebParam(name = "userId") String userId,
            @WebParam(name = "scheduleId")int scheduleId);

    /**
     * 用户提交突发事件
     * */
    @WebResult(name = "result")
    public Result commitSuddenEvents(@WebParam(name = "userId") String userId,
            @WebParam(name = "eventType") int eventType,
            @WebParam(name = "positionId") int positionId);

    /**
     * 巡查员获取导览员信息
     * */
    @WebResult(name = "result")
    public List<UserModel> getAllGuides(@WebParam(name = "userId") String userId)
            throws WebServcieException;

    /**
     * 巡查员评价导览员
     * */
    @WebResult(name = "result")
    public Result rateGuide(
            @WebParam(name = "supervisorId") String supervisorId,
            @WebParam(name = "rate") Rate rate);

    /**
     * 巡查员提交突发事件处理结果
     * */
    @WebResult(name = "result")
    public Result commitSuddenEventsResult(
            @WebParam(name = "userId") String userId,
            @WebParam(name = "state") int state,
            @WebParam(name = "eventId") int eventId,
            @WebParam(name = "remark") String remark);

    /**
     * 发送推送消息
     * */
    public void sendBroadcast(@WebParam(name = "title") String title,
            @WebParam(name = "message") String message,
            @WebParam(name = "url") String url);

    /**
     * 针对用户发送推送消息
     * */
    @WebResult(name = "result")
    public int sendNotifcationToUser(@WebParam(name = "userId") String userId,
            @WebParam(name = "title") String title,
            @WebParam(name = "message") String message,
            @WebParam(name = "messageId") int messageId);

    /**
     * 获取用户所在地区的position信息
     * */
    @WebResult(name = "result")
    public Position getPosition(@WebParam(name = "userId") String userId);
    
    /**
     * 获取的position信息
     * */
    @WebResult(name = "result")
    public List<Position> getAllPositions();

    /**
     * 获取预处理结果
     * */
    @WebResult(name = "result")
    public EventMethod getEventMethod(
            @WebParam(name = "eventType") int eventType);
    
    /**
     * 获取所有事件类型
     * */
    @WebResult(name = "result")
    public List<Integer> getAllEvents();
    
    /**
     * 下载用户信息
     * */
    @WebResult(name="result")
    public UserInfoModel downloadUserModel( @WebParam(name = "userId")String userId);
    
    /**
     * 巡查员获取导览员信息
     * */
    @WebResult(name = "result")
    public List<UserInfoModel> getAllUsers(@WebParam(name = "userId") String userId)
            throws WebServcieException;
    
    /**
     * 巡查员获取导览员信息根据点位信息
     * */
    @WebResult(name = "result")
    public List<UserInfoModel> getUsersByPositionId(@WebParam(name = "positionId") int positionId);
    
    
    /**
     * 巡查员获取导览员信息根据点位信息
     * */
    @WebResult(name = "result")
    public List<String> getUserNameByPositionId(@WebParam(name = "positionId") int positionId);
    
    /**
     * 下载用户图片
     * */
    
    @WebResult(name="result")
    public Result downloadUserPhoto( @WebParam(name = "userId")String userId);
    
    /**
     *状态查询
     * */
    
    @WebResult(name="result")
    public Result getUserState( @WebParam(name = "userId")String userId);
    /**
     *根据督导员id
     *和eventId查询突发事件
     * */
    
    @WebResult(name="result")
    public List<SuddenEventsModel> getSuddenEvents( @WebParam(name = "userId")String userId,@WebParam(name = "eventId")int eventId);
    
    /**
     * 读取该条信息
     * */
    @WebResult(name="result")
    public Result readMessage( @WebParam(name = "userId")String userId, @WebParam(name = "messageId")int messageId);
    
    /**
     * 获取推送未读消息
     * 
     **/
     @WebResult(name="result")
     public Result getUnReadMessages(@WebParam(name = "userId")String userId);
     
     
     /**
      * 获取所有推送消息
      * 
      **/
      @WebResult(name="result")
      public Result getAllMessages(@WebParam(name = "userId")String userId);
      
      /**
       *获取系统时间
       * 
       **/
       @WebResult(name="result")
       public Result getSystemTime();
       
       /**
        *获取系统时间
        * 
        **/
        @WebResult(name="result")
        public int writeProps(@WebParam(name = "key")String key,@WebParam(name = "value")String value);
        
        
        /**
         *获取当前考勤信息
         * 
         **/
        @WebResult(name="result")
        public Attendence getCurrentAttendence(@WebParam(name = "userId")String userId);

        /**
         *根据主键获取用户信息
         * 
         **/
        @WebResult(name="result")
        public UserInfoModel getUserInfoModelById(@WebParam(name = "id")int id);
        
        /**
         *获取系统时间(long)
         * 
         **/
        @WebResult(name="result")
        public Result getTime();
        
        
        /**
         *获取用户上级
         * 
         **/
        @WebResult(name="result")
        public UserInfoModel  getTopUserInfoModelById(@WebParam(name = "roleId")int roleId,@WebParam(name = "userId")String userId);
        
        /**
         *获取用户是否可以签退
         * 
         **/
        @WebResult(name="result")
        public  Result getSignOutState(@WebParam(name = "userId")String userId);
        
        /**
         *提交用户当前位置
         * 
         **/
        @WebResult(name="result")
        public  Result commitUserPosition(@WebParam(name = "userId") String userId,
                @WebParam(name = "XGPS") String XGps,
                @WebParam(name = "YGPS") String YGps);
        
         

}
